<nz-breadcrumb class="breadcrumb">
  <nz-breadcrumb-item>
    <a routerLink="/Home">首页</a>
  </nz-breadcrumb-item>
  <nz-breadcrumb-item>员工基本信息列表</nz-breadcrumb-item>
</nz-breadcrumb>
<form nz-form class="search-form" [formGroup]="searchForm" (keydown.enter)="$event.preventDefault();onSearch()" nzLayout="inline">
  <nz-form-item>
    <nz-form-label nzFor="enterpriseName">企业名称</nz-form-label>
    <nz-form-control>
      <nz-input-group nzSearch [nzAddOnAfter]="enterpriseNameSuffixIconButton">
        <input nz-input formControlName="enterpriseName" placeholder="请选择企业名称" readonly />
      </nz-input-group>
      <ng-template #enterpriseNameSuffixIconButton>
        <button nz-button nzType="primary" nzSearch (click)="findEnterprise()"><nz-icon nzType="search" /></button>
      </ng-template>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzFor="employeeNumber">工号</nz-form-label>
    <nz-form-control>
      <input nz-input formControlName="employeeNumber" placeholder="请输入工号" />
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzFor="name">姓名</nz-form-label>
    <nz-form-control>
      <input nz-input formControlName="name" placeholder="请输入姓名" />
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzFor="departmentName">部门名称</nz-form-label>
    <nz-form-control>
      <nz-input-group nzSearch [nzAddOnAfter]="departmentNameSuffixIconButton">
        <input nz-input formControlName="departmentName" placeholder="请选择部门名称" readonly />
      </nz-input-group>
      <ng-template #departmentNameSuffixIconButton>
        <button nz-button nzType="primary" nzSearch (click)="findDepartment()"><nz-icon nzType="search" /></button>
      </ng-template>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzFor="positionName">岗位名称</nz-form-label>
    <nz-form-control>
      <nz-input-group nzSearch [nzAddOnAfter]="positionNameSuffixIconButton">
        <input nz-input formControlName="positionName" placeholder="请选择岗位名称" readonly />
      </nz-input-group>
      <ng-template #positionNameSuffixIconButton>
        <button nz-button nzType="primary" nzSearch (click)="findPosition()"><nz-icon nzType="search" /></button>
      </ng-template>
    </nz-form-control>
  </nz-form-item>
  <button nz-button type="button" nzType="primary" [nzLoading]="searchLoading" (click)="onSearch()">查询</button>
  <button nz-button type="button" class="margin-button" (click)="onReset()">重置</button>
  <button nz-button type="button" class="margin-button" nzType="primary" (click)="onAdd()">新增</button>
  <button nz-button type="button" class="margin-button" nzType="primary" [nzLoading]="searchLoading" (click)="onExport()">导出</button>
</form>
<nz-table #basicTable [nzData]="listOfData" [nzTotal]="total" [nzLoading]="searchLoading" nzSize="small" [nzScroll]="{ x: 'auto' }">
  <thead>
    <tr>
      <th nzWidth="180px">企业名称</th>
      <th nzWidth="120px">工号</th>
      <th nzWidth="120px">姓名</th>
      <th nzWidth="120px">密码</th>
      <th nzWidth="120px">性别</th>
      <th nzWidth="120px">出生日期</th>
      <th nzWidth="120px">联系电话</th>
      <th nzWidth="200px">邮箱</th>
      <th nzWidth="120px">省</th>
      <th nzWidth="120px">市</th>
      <th nzWidth="120px">区</th>
      <th nzWidth="200px">家庭地址</th>
      <th nzWidth="120px">聘用日期</th>
      <th nzWidth="120px">部门名称</th>
      <th nzWidth="120px">岗位名称</th>
      <th nzWidth="250px" nzRight>操作</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of basicTable.data">
      <td>{{data.enterpriseName}}</td>
      <td>{{data.employeeNumber}}</td>
      <td>{{data.name}}</td>
      <td>{{data.password}}</td>
      <td>
        <ng-container *ngIf="data.gender === 1">男</ng-container>
        <ng-container *ngIf="data.gender === 2">女</ng-container>
      </td>
      <td>{{data.birthDate}}</td>
      <td>{{data.contactPhone}}</td>
      <td>{{data.email}}</td>
      <td>{{data.provinceName}}</td>
      <td>{{data.cityName}}</td>
      <td>{{data.areaName}}</td>
      <td>{{data.address}}</td>
      <td>{{data.hireDate}}</td>
      <td>{{data.departmentName}}</td>
      <td>{{data.positionName}}</td>
      <td nzRight>
        <button nz-button type="button" nzType="primary" (click)="editRow(data.id)">编辑</button>
        <button nz-button type="button" nzDanger class="margin-button" (click)="delRow(data.id)">删除</button>
        <button nz-button type="button" class="margin-button" (click)="detailRow(data)">详情</button>
      </td>
    </tr>
  </tbody>
</nz-table>
<enterprise-selector (enterpriseSelectedEvent)="handleEnterpriseSelectedEvent($event)"></enterprise-selector>
<department-selector (departmentSelectedEvent)="handleDepartmentSelectedEvent($event)"></department-selector>
<position-selector (positionSelectedEvent)="handlePositionSelectedEvent($event)"></position-selector>
<employee-add (addedEvent)="onAdded($event)"></employee-add>
<employee-view></employee-view>
